package edu.uwlax.cs.oayonlinestore.client.gui.shop;

import edu.uwlax.cs.oayonlinestore.client.OnlinestoreRService;
import edu.uwlax.cs.oayonlinestore.client.utils.Text;
import edu.uwlax.cs.oayonlinestore.client.utils.TitlePage;
import edu.uwlax.cs.oayonlinestore.vo.CategoryVO;

public class PageCategory extends TitlePage {

	private Text desctiption;

	protected void create() {
		setTitle("Category");
		add(desctiption = new Text());
	}

	public String getID() {
		return "Category";
	}

	protected void onDataArrived(Object o) {
		CategoryVO cat = (CategoryVO) o;
		setTitle("Category: " + cat.getTitle());
		desctiption.setText(cat.getDescription());
	}

	protected boolean onShow(int param) {
		OnlinestoreRService.Util.getInstance().getCategory(param,
				getAsyncHandler());
		return true;
	}
}
